package org.example.zrccddllljh.Mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.example.zrccddllljh.Pojo.Admin;

import java.util.List;


@Mapper
public interface AdminMapper {
    @Select("select * from admin where username=#{username};")
    Admin findByUserName(String username);

    @Insert("insert into admin (username,password,create_time,update_time) values (#{username},#{password},now(),now() ) ")
    void add(String username, String password);
@Update("update admin set  password=#{md5String},update_time=now()  where id=#{id} ;")
    void updatePwd(String md5String, Integer id);

    @Update("update admin set pic=#{avatarUrl},update_time=now() where id=#{id}")
    void updateAvatar(String avatarUrl,Integer id);
@Update("update admin set username =#{username}  where id=#{id};")
    void updata(Admin admin);
@Select("select password from admin where username=#{o} ;")
List<Admin> password(String o);
}
